addr, port, user, pwd = "192.168.1.41", 9000, 'user1', 'password'
with qconnection.QConnection(host=addr,port=port,username=user,password=pwd) as q:
    queryStr = '.gw.asyncexec[(`GetLatestJsonTree;()); `JsonTreeDB]'
    q.async(queryStr)
    tupList =q.receive()
print tupList[0][0]


addr, port = "192.168.1.44", 58764
with qconnection.QConnection(host=addr,port=port) as q:
    f=q.sync('select json from jsoncode where date=last date')[0][0]
    print f
    
    
addr, port, user, pwd = "192.168.1.41", 9000, 'superuser1', 'password'
with qconnection.QConnection(host=addr,port=port,username=user,password=pwd) as q:
    queryStr = '.gw.asyncexec[(`GetFeeRateData;(2016.09.30); (0)); `FeeRateDB]'
    print queryStr
    q.async(queryStr)
    tupList =q.receive(pandas=True)
    print tupList

    
addr, port, user, pwd = "192.168.1.41", 9000, 'superuser1', 'password'
with qconnection.QConnection(host=addr,port=port,username=user,password=pwd) as q:
    queryStr = '.gw.asyncexec[(`GetFeeRateData;(2016.09.30;0)); `FeeRateDB]'
    print queryStr
    q.async(queryStr)
    tupList =q.receive(pandas=True)
    print tupList